package com.serkol.driving.learning.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.serkol.bean.LoginConfig;
import com.serkol.bean.MyPage;
import com.serkol.driving.learning.entity.Users;
import com.serkol.exception.AuthException;

import java.util.List;
import java.util.Map;

/**
* @author pingan
* @description 针对表【users】的数据库操作Service
* @createDate 2022-09-16 19:40:18
*/
public interface UsersService extends IService<Users> {

    Users findByLogin(String openid);


    Users findByLoginAndInsert(Users usersDetail);


    Users findByUserId(Long userId);
    Long findByUserCount(Long userId);

    boolean editPhoneNumber(String phoneNumber);


    Map<Integer, Users> getParentUsersLevel(Users byUserId);
    List<Long> getParentUsersLevelIds(long parentId);

    List<Long> getFindChildrens(long parentId);



    Users findByUserLogin(LoginConfig loginConfig) throws AuthException;

    MyPage findByList(int pageSize, int page, String invite, String userName, String nickname, String phone);

    Map<String, Object> getCurrentUser();






    Map<String, Object> findById(long id);

    boolean isPhoneValid(String phone);

    Users findByUserPhone(String phone);

    boolean isPhoneAndIdValid(String phone, Long id);

    boolean isUsers(Long parentUserId);

    Map<String, Object> findByUserAuthPhone(String phone);

    Map<String, Object> getUserStastic();

    boolean changeAvatar(Long userId, Long id, String url);

    Map<String, Object> findBySuorceId(Long userId);

    List<Map<String, Object>> findMyParentList(long userId);

}
